﻿using UnityEngine;
using System.Collections;

public class MeRoot : UIRoot
{
		bool mAdjustment = false;
		static float mPixelSizeAdjustment = 1.0f;

		void Start ()
		{
		}

		void Update ()
		{
				if (!mAdjustment) {
						mAdjustment = true;
						float calcActiveHeight = activeHeight;
						if (calcActiveHeight > 0f) {
								float size = 2f / calcActiveHeight;
				
								Vector3 ls = transform.localScale;
				
								if (!(Mathf.Abs (ls.x - size) <= float.Epsilon) ||
										!(Mathf.Abs (ls.y - size) <= float.Epsilon) ||
										!(Mathf.Abs (ls.z - size) <= float.Epsilon)) {
										mPixelSizeAdjustment = (float)((double)manualHeight * size / transform.localScale.y / Screen.height);
					
								} else {
										mPixelSizeAdjustment = manualHeight / Screen.height;
								}
						}
				}
		}

		public override float pixelSizeAdjustment { 
				get {
						

						return mPixelSizeAdjustment;
				}
		}

		public static float GetPixelSizeAdjustment ()
		{
				return mPixelSizeAdjustment;
		}
}
